<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/22 0022
 * Time: 17:49
 */

namespace app\api\controller;


class Townconfig extends BaseController
{
    public function getConfig()
    {
        $param = self::getHttpParam();
        if (empty($param->townId)) {
            return show(config('status.ERROR_STATUS'), self::NOT_PARAM, 'townId不能为空');
        } else {
            $town = Townconfig::where('townId', $param->townId)->find();
            if (empty($town)) {
                return show(config('status.ERROR_STATUS'), self::NOT_DATA, '未查到相关信息');
            } else{
                return show(config('status.SUCCESS_STATUS'), self::MSG_SUCCESS, $town);
            }
        }
    }

}